<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="/css/common.css" />
<link rel="stylesheet" type="text/css" href="/bootstrap-3.3.7/css/bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="/css/flatpickr.min.css" />
<link rel="stylesheet" type="text/css" href="/css/font-awesome.css" />
<link rel="stylesheet" type="text/css" href="/dialog/css/dialog.css" />

<script src="/js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="/js/google-maps.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/jquery.validate.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/dialog/js/dialog.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/jquery.form.js"></script>
<script src="/js/common.js"></script>
<script src="/js/flatpickr.js" type="text/javascript" charset="utf-8"></script>
<script src="/js/messages_zh.min.js" type="text/javascript" charset="utf-8"></script>
</head>

<body>
	<!--顶部导航 -->
		<nav class="topNavItemBox">
			<div id="ItemBox">
				<div class="title">肉品溯源管理系统</div>
			</div>
		</nav>
		<!-- 左侧导航 -->
		<#include "left.ftl"/>

    <!-- 新增供应商信息 -->
	<div class="page_main">
		<h3>新增供应商信息</h3><span class="add_link"><a href="supplier_manage.ftl">查询供应商信息></a></span>
		<br />
		<div class="page_content">

			<form id="quarantine_addform" action="CompanyAction_addCompany"
				method="post">
				<ul>
					<li><label class="labelBeforinput">*公司名称</label><input	name="compName" class="bigInputtext" required type="text" /></li>
					<li><label class="labelBeforinput">*公司类型</label><!-- 	<input	 name="compTypeCode.compTypeId" class="bigInputtext" required type="text">  --><select name="compTypeCode.compTypeId" class="bigSelect" data-rule-notZero="true" >
							<option value="0">请选择</option>
							<option value="4">饲料生产商</option>
							<option value="5">饲料供应商</option>
							<option value="6">疫苗生产商</option>
							<option value="7">疫苗供应商</option>
						</select>
					<li><label class="labelBeforinput">*组织机构代码</label><input name="compCode" class="bigInputtext" required type="text" /></li>
					<!-- <li><label class="labelBeforinput">终端编号</label><input name="sensorlD" class="bigInputtext"  type="text" /></li> -->
<!-- 					<li><label class="labelBeforinput">*创立时间(底层插入当前系统时间)</label><input	name="foundedTime" class="bigInputtext" type="text" required /></li> -->
					<li><label class="labelBeforinput">*注册地址</label><input	type="text" name="regAddr"	class="bigInputtext" required/>
					<li><label class="labelBeforinput">*注册资金</label><input	name="capital" type="text" data-rule-isIntGtZero="true"	class="bigInputtext"  required /></li>
					<li><label class="labelBeforinput">*经营范围</label><input name="business"	class="bigInputtext" data-rule-isChinese="true" required /></li>
					<li><label class="labelBeforinput">*法人</label><input name="legalPname" class="bigInputtext" data-rule-isChinese="true" required /></li>
					<li><label class="labelBeforinput">*法人身份证号</label><input name="legalCode" class="bigInputtext" data-rule-isIDcard="true" required /></li>
					<li><label class="labelBeforinput">*联系人</label><input name="contacts" class="bigInputtext" data-rule-isChinese="true" required /></li>
					<li><label class="labelBeforinput">*联系人电话</label><input name="contactsPhone" data-rule-isTel="true" class="bigInputtext" required /></li>
					<li><label class="labelBeforinput">*联系人传真</label><input name="contactsFax" data-rule-isIntGtZero="true" class="bigInputtext" required /></li>
					<li><label class="labelBeforinput">*投诉电话</label><input name="complaintPhone" data-rule-isTel="true" class="bigInputtext" required /></li>
					<li><label class="labelBeforinput">*企业等级</label><input name="companyLevel"	class="bigInputtext" required /></li>
					<li><label class="labelBeforinput">*企业资质</label><input name="companyCert" class="bigInputtext" required /></li>
					<li><label class="labelBeforinput">企业备注说明</label><input name="remark" class="bigInputtext" required /></li>

					<li><input type="submit" value="添加记录"
						style="margin-left: 170px; width: 200px;" /></li>
				</ul>
			</form>
		</div>
		<div class="footer">
				<div class="footer_lineone">
					<span id="logo"></span>肉品溯源管理系统 
					<span class="footer_lineoneSpan"><a href="aboutus.html">关于我们</a></span>
					<span class="footer_lineoneSpan"><a target="_blank" href="http://www.cfsiw.com/">食品安全信息</a></span> 
					<span class="footer_lineoneSpan"><a href="suggestionAdd.ftl">联系我们</a></span>
				</div>
				<div class="footer_linetwo">
					 &copy;2017广东技术师范学院
				</div>
			</div>
	</div>
</body>
<script>
	$(function() {
		//初始化侧边栏
		$(".vertical-nav").verticalnav({
			speed : 400,
			align : "left"
		});

		//时间控制器
		$("#beginTime").flatpickr();
		$("#endTime").flatpickr();
		$("#inTime").flatpickr();
		//表单校验
		$("#quarantine_addform").validate();
		
		//表单提交
		$("#quarantine_addform")
				.ajaxForm(
						{
							/* error: function(XMLHttpRequest, textStatus, errorThrown){
								//失败
								$.dialog({
									type: 'info',
									contentHtml: '<img class="info-icon" src="dialog/images/icon/fail.png" alt="增加失败" /><p class="info-text">请输入正确的生猪编号</p>',
									autoClose: 2000
								});
							}, */
							success : function(data) {
								var str = null;
								var msg = null;
								if (data.msg == 1) {
									str = "success";
									msg = "企业创建成功";
								} else {
									str = "fail";
									msg = data.msg;
								}
								console.log(data);
								$
									.dialog({
										type : 'confirm',
										contentHtml : '<img class="info-icon" src="dialog/images/icon/'+str+'.png" alt="'+msg+'" /><p class="info-text">'
												+ msg + '</p>',
										onClickCancel:function(){
											window.location.href="www.baidu.com";		
										},
										onClickOk:function(){
											location.reload();
										}
												
									});
								
							}
						});
	});
</script>

</html>